This application is based on and incorporates herein by reference Japanese Patent Application No. 2001-389541 filed on Dec. 21, 2001.
This invention relates to an output circuit which operates with a control power source voltage and outputs a logic signal to an external circuit, and to a microcomputer provided with the output circuit.
A one-chip microcomputer 1 includes, as shown in FIG. 5, a CPU 2 which operates with a control power source voltage VCC1 of, for example, 3.3 V, and a plurality of output ports 5 (FIG. 5 illustrates only one) that convert logic signals output from the CPU 2 into logic signals of a 5-volt system and output them to an external circuit 4 through output terminals 3. Each output port 5 is constructed with a level shift circuit 6 that operates with a control power source voltage VCC2 of 5 V, inverters 7 and 8, an output circuit 9, and the output terminal 3. The output circuit 9 is a totem-pole type circuit comprising a p-channel MOS transistor 10 and an n-channel MOS transistor 11.
The microcomputer 1 can be applied to a variety of control devices. When applied to, for example, an ECU (electronic control unit) mounted on a vehicle, a power source circuit (not shown) provides control power source voltages VCC1 (3.3 V) and VCC2 (5 V) based on a battery voltage VB (12 V).
However, the above control power source voltages VCC1 and VCC2 assume an intermediate value between 3.3 V and 0 V, and an intermediate value between 5 V and 0 V, respectively, when the battery voltage VB drops instantaneously. This voltage drop may arise, for instance, when the ignition switch of the vehicle is changed from OFF to ON or from ON to OFF, when the battery is discharged too much, or when the vehicle is involved in an accident such as collision.
In the case of a CMOS circuit, the elements of the logic circuit undergo unstable logic operation when the control power source voltage becomes smaller than a threshold voltage Vth of the MOS transistor, and the output level loses stability. In the case of a 2-input NAND circuit, it is necessary, in principle, to apply an input voltage which is two or more times as great as the threshold voltage Vth in order to normally output the L-level.
In a low-voltage state where the control power source voltages VCC1 and VCC2 are smaller than the above values, therefore, the CPU 2 and the output port 5 lose stability in the operations often causing the MOS transistor 10 or 11 that should have been turned off to be turned on. In this case, when the MOS transistor 10 or 11 is turned on, the control power source voltage VCC2 or 0 V is output from the output terminal 3 and an electric current flows to the external circuit 4. Due to the output voltage or output current, therefore, an erroneous logic signal is transmitted to the external circuit 4 and as a result the external circuit 4 operates erroneously.
Therefore, the erroneous signals has been prevented by verifying the states of the ports by simulation or testing at the time when the control power source voltages VCC1 and VCC2 are raised or broken or by so designing that the microcomputer 1 and the external circuit 4 work as a whole in cooperation together (e.g., by increasing the capacity when the external circuit 4 is a capacitor). However, limitation is imposed on the external circuit 4 that can be connected, and a lot of laborious work is required for the verification operation or for the cooperative designing as the circuit construction becomes complex.
It is therefore an object of the present invention to provide an output circuit capable of reliably producing a predetermined logic signal properly even in a case that the control power source voltage drops, and a microcomputer provided with such an output circuit.
According to the present invention, a logic circuit produces a drive control signal to a control signal input terminal of an output transistor, and the output transistor produces a logic signal corresponding to the drive control signal when a control power source voltage lies in an ordinary voltage range or when the control power source voltage that has dropped is still higher than an operation guarantee voltage level (or is higher than a predetermined value that has been set to be higher than the operation guarantee voltage level) on which the logic circuit normally performs the logic operation. In this case, the output transistor performs an operation (source operation) for flowing out an electric current or an operation (sink operation) for absorbing a current depending upon the type of electric conduction thereof or the mode of connection.
A logic circuit is provided with an output shut-off control circuit in a passage for transmitting a drive control signal to the control signal input terminal of the output transistor. In this case, however, the output shut-off control circuit directly produces the drive control signal. Further, a resistance element is connected between the control signal input terminal (gate, base) of the output transistor and the control signal reference terminal (source, emitter). Here, however, the output transistor is turned on or off according to a drive control signal irrespective of the presence of the resistance element. Therefore, the output circuit produces the logic signal in compliance with the drive control signal.
On the other hand, when the control power source voltage has dropped to be lower than the operation guarantee voltage level, the logic circuit may operate unstably failing to normally execute the logic operation. In this case, the output shut-off control circuit produces an output shut-off signal for turning off the output transistor instead of producing the drive control signal. Therefore, even when the logic circuit loses stability in the operation due to a decrease in the control power source voltage, it is allowed to control the output transistor to be turned into OFF.
As the control power source voltage further decreases, however, the output shut-off control circuit constructed with an active element may fail to normally produce the output shut-off signal. In this case, the resistance element works to bring the potential at the control signal input terminal to be close to the potential at the control signal reference terminal. Even when an ON-drive control signal is given to the output transistor, the output transistor is maintained turned off. According to this output circuit, therefore, when at least the control power source voltage has dropped to be lower than the operation guarantee voltage level and the logic circuit is not capable of normally executing the logic operation, the output transistor is reliably controlled to assume a predetermined state, i.e., is turned off, and a predetermined logic signal is reliably output to the external circuit.